<?php
// +----------------------------------------------------------------------
// | Yzncms [ 御宅男工作室 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2018 http://yzncms.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | fastadmin: https://www.fastadmin.net/
// +----------------------------------------------------------------------

// +----------------------------------------------------------------------
// | 手机短信接口
// +----------------------------------------------------------------------
namespace app\api\controller;

use app\api\model\Token;
use app\common\controller\Api;
use app\common\library\Sms as Smslib;
use app\common\model\FishLoc;
use app\common\model\MemberModel;
use app\common\model\RebateLog;
use app\member\model\Member;
use think\facade\Hook;
use think\facade\Validate;
use think\Request;
use util\Http;

/**
 * @title 地点
 * @controller api\controller\Sms
 * @group base
 */
class Loc extends Api
{

    protected $noNeedLogin = ['getLocList','locRebate'];

    /**
     * @title 上传地点
     */
    public function uploadLoc()
    {
        $data = (new FishLoc())->addLoc($this->request_array);
        $data['code'] == 200 ? $this->success($data['msg'], $data['data']) : $this->error($data['msg']);
    }


    public function deleteLoc(){
        $data = (new FishLoc())->delLoc($this->request_array);
        $data['code'] == 200 ? $this->success($data['msg'], $data['data']) : $this->error($data['msg']);
    }


    public function updateLoc(){
        $data = (new FishLoc())->updateLoc($this->request_array);
        $data['code'] == 200 ? $this->success($data['msg'], $data['data']) : $this->error($data['msg']);
    }


    /**
     * @title 获取附近100公里的钓点
     */
    public function getLocList()
    {
        $data = (new FishLoc())->getLocList($this->request_array);
        $data['code'] == 200 ? $this->success($data['msg'], $data['data']) : $this->error($data['msg']);
    }


    /**
     * @title 获取用户钓点列表
     */
    public function getUserLocList()
    {
        $data = (new FishLoc())->getUserLocList($this->request_array);
        $data['code'] == 200 ? $this->success($data['msg'], $data['data']) : $this->error($data['msg']);
    }




    /**
     * @title 返现
     */
    public function locRebate(){
        $data = (new FishLoc())->rebate($this->request_array);
        $data['code'] == 200 ? $this->success($data['msg'], $data['data']) : $this->error($data['msg']);

    }

    /**
     * @title 获取该钓点每天播放次数
     */
    public function getLocVideoNum(){
        $data = (new FishLoc())->getLocVideoNum($this->request_array);
        $data['code'] == 200 ? $this->success($data['msg'], $data['data']) : $this->error($data['msg']);
    }


    /**
     * @title 获取该钓点每天播放次数
     */

    public function getYesterdayLog(){
        $data = (new RebateLog())->getYesterdayLog($this->request_array);
        $data['code'] == 200 ? $this->success($data['msg'], $data['data']) : $this->error($data['msg']);
    }




}
